﻿#region Using
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Eloje_Data;
#endregion

#region Namespace
namespace eLoje
{
    /// <summary>
    /// Interaction logic for Principal.xaml
    /// </summary>
    #region Classe
    public partial class Principal : Window
    {
        #region Contrutores
        public Principal()
        {
            InitializeComponent();
            loadForm();
        }
        #endregion

        #region Propriedades
        private UCMedidaList medidaList = new UCMedidaList();
        private UCMedidaNew medidaNew = null;
        #endregion
        #region Eventos
        private void medida_Click(object sender, RoutedEventArgs e)
        {
            gridHost.Children.Clear();
            gridHost.Children.Add(medidaList);
        }
        #endregion

        #region Metodos
        private void loadForm()
        {
            medidaList.BotaoClicado += new UCMedidaList.BotaoClicadoEventHandler(updateGrid_BotaoClicado);
        }

        void updateGrid_BotaoClicado(object sender, BotaoArgs e)
        {
            switch (e)
            {
                case  BotaoArgs.NOVA_MEDIDA:
                    gridHost.Children.Clear();
                    medidaNew = new UCMedidaNew();
                    gridHost.Children.Add(medidaNew);
                    break;
                default:
                    gridHost.Children.Clear();
                    // EmConstrucao construcao = new EmConstrucao();
                    // gridHost.Children.Add(new EmConstrucao());

                    break;
            }

        }
        #endregion
    }
    #endregion
}
#endregion